#include<iostream>
#include<vector>

using namespace std;

int gcd(int a, int b){
	if(b){
		return gcd(b, a%b);
	}
	return a;
}

int main(){
	int n,c=0;
	cin>>n;
	vector<int> nums(n,0);
	
	for(int i=0;i<n;i++){
		cin>>nums[i];
		c = max(c, nums[i]);
	}
	
	vector<int> g(c + 1);
	
	for (int x: nums) {
        for (int y = 1; y * y <= x; ++y) {
            if (x % y == 0) {
                if (!g[y]) {
                    g[y] = x;
                }
                else {
                    g[y] = gcd(g[y], x);
                }
                if (y * y != x) {
                    int z = x / y;
                    if (!g[z]) {
                        g[z] = x;
                    }
                    else {
                        g[z] = gcd(g[z], x);
                    }
                }
            }
        }
    }
        
    int ans = 0;
    for (int i = 1; i <= c; ++i) {
        if (g[i] == i) {
            ++ans;
        }
    }
    cout<<ans;
	return 0;
}
